1. Field of the Invention
The present invention relates to a distance measuring apparatus and to a method for measuring the distance from the apparatus to an object by imaging light which has been emitted from the apparatus, passed through a slit and been reflected off the object, and then referring to a positional relationship between the light emission position and the image position.
2. Description of the Related Art
Recently, CCD (Charged Coupled Device) cameras and computer image processing techniques have been improved, and accordingly, three-dimensional measurement methods using images have become common. An example of such three-dimensional measurement methods using a CCD camera and computer image processing is a light-section method. In the light-section method, light passing through a slit is projected onto a target object to be measured, so as to virtually cut the object using a band-shaped light, and a cut surface is observed in a direction other than the direction of the projected light. Because very fine and intense light beams can be obtained by laser technology, even an object having an irregular surface can be measured at high speed and with high accuracy by employing three-dimensional measurement using the light-section method.
Generally, in the light-section method, the distance to the target object is determined using the principle of triangulation. In triangulation, a triangle is defined by connecting two known reference points and any other third point, and the position of the third point is determined by measuring the angles of the triangle. More specifically, in the light-section method, light which is emitted from a light source within a distance measuring apparatus and passes through a slit is projected onto an object, and the reflected light from the surface of the object is imaged by a CCD camera provided within the distance measuring apparatus. The distance between the distance measuring apparatus and the target object is measured based on the direction of the emitted light and the positions of the light source and the CCD camera. Therefore, it is preferable that the intensity of the reflected light imaged by the CCD camera is constant.
However, even if the intensity of the light which is emitted from the distance measuring apparatus and passes through a slit is constant, the intensity of the reflected light varies according to the distance to the object and the reflective properties of the surface of the object. The measurement principles of the light-section method require that an image of the light which passes through a slit (also referred to hereunder as slit light) be taken continuously by the CCD camera. Conventionally, in three-dimensional measurement using the light-section method, because the approximate distance to the object and the state of the surface of the object to be measured are known to some extent, measurement is generally performed after the intensity of the slit light, and the dynamic range of the CCD camera have been adjusted during a calibration time prior to the measurement.
However, when a floor surface or an obstacle on a floor surface is detected using the light-section method in a visual sensor of a self-controlled robot, because the distance to the object to be measured and the reflective properties of the surface of the object are unknown, the intensity of the slit light and the dynamic range of the CCD camera cannot realistically be pre-adjusted. Consequently, measurements must be performed using an apparatus having a dynamic range which covers the range of light from weak light to strong light, using laser light having a predetermined intensity. However, depending on the distance to the object or the reflective properties of the object, a problem can occur when the light is not within the dynamic range of the CCD camera. In particular, because the light-section method recognizes the shape of the object and measures the distance to the object according to the state of the image taken of the slit light, when imaging cannot be performed for the slit light, it is not possible to ascertain whether imaging is impossible because of the influence of the dynamic range, or because the light is lost in the shadows of the object, and as a result distance measurement and recognition of the object cannot be performed accurately. Furthermore, another problem is that strong light passed through the slit is imaged as thick light, and so it is difficult to obtain an accurate position for the object.
In consideration of the above circumstances, an object of the present invention is to provide a distance measuring apparatus and a distance measuring method utilizing a light-section method capable of measuring both close objects and far away objects without adjusting the dynamic range of the imaging camera.
A distance measuring apparatus according to the present invention comprises: an image acquisition section for imaging reflected light which has been emitted from the apparatus, has passed through a slit, and has then been reflected off the surface of a target object to be measured; an emission control section for controlling the emission time of the light which is emitted and passes through the slit during the time an image is being scanned by the image acquisition section, and for changing the intensity of the received light in the image acquisition section; and a distance calculation section for calculating the distance to the object based on the image taken by the image acquisition section by referring to a positional relationship between a light emission position of the light passing through the slit and an image position.
In a distance measuring method according to the present invention, light which has passed through a slit is emitted onto a target object to be measured, and light reflected by the object is imaged by an imaging section, and based on the obtained image, the distance to the object is measured by referring to a positional relationship between a light emission position of the light which has passed through the slit and an image position, and moreover when the light passed through the slit is projected onto the object, an emission time of the light passed through the slit is varied within a time period during which the imaging section scans the image.
According to the present invention, in a case where light which has been emitted from an apparatus, passed through a slit, and reflected off an object is imaged, and the distance to the object is then measured by referring to a positional relationship between the light emission position of the slit light and the image position, then because measurement is performed by, for example, diffusing laser light emitted by the apparatus in one direction and creating slit light and projecting this slit light onto the object to be measured, and then changing the emission time of the slit light within the scanning time of the image acquisition section, the brightness distribution of the imaged slit light becomes uniform, and imaging of the slit light can be performed with certainty. As a result, the distance accuracy can be improved, and the distance measurement processing can be simplified. In this way, regarding a problem in that when an obstacle is detected using the light-section method in a visual sensor of a self-controlled robot, recognition of an object and distance measurement cannot be performed accurately, the present invention can ensure that the brightness distribution of slit light becomes uniform, thereby improving the accuracy for recognition of an object and distance measurement.
In the distance measuring apparatus, the emission control section may also be constructed so as to determine the emission time according to the intensity of the reflected light received by the image acquisition section. In the same manner, in the distance measuring method, the intensity of the emitted light which passes through the slit may be changed in accordance with the intensity of the imaged light reflected off the surface of the object.
Consequently, the brightness distribution of the reflected light can be reliably converted to a uniform level, even for unknown objects.